package com.hongxun.modules.sys.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import com.hongxun.modules.sys.entity.SysUserEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 系统用户
 */
@Mapper
public interface SysUserDao extends BaseDao<SysUserEntity> {
	
	/**
	 * 查询用户的所有权限
	 * @param userId  用户ID
	 */
	List<String> queryAllPerms(Long userId);
	@Select("SELECT * FROM sys_user where dept_id= #{deptid} ")
	List<SysUserEntity> queryListBydeptid(@Param("deptid") Long deptid);
	/**
	 * 查询用户的所有菜单ID
	 */
	List<Long> queryAllMenuId(Long userId);
	
	/**
	 * 根据用户名，查询系统用户
	 */
	SysUserEntity queryByUserName(String username);
	SysUserEntity queryByUserName1(String username);
	
	SysUserEntity queryByAccount(String account);
	List<SysUserEntity> queryAll();
	/**
	 * 根据手机号，查询系统用户
	 */
	SysUserEntity queryByMobile(String moblie);
	
	/**
	 * 修改密码
	 */
	int updatePassword(Map<String, Object> map);
	List<SysUserEntity> queryUserListByUser(Long parentId);
}
